﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace User.XCloudSDK
{
    public enum EXSDK_ERROR
    {
        EXSDK_ER_OK = 0,
        EXSDK_ER_OBJ_NOT_EXIST = -1239510,
        EXSDK_ER_VALUE_NOT_EXIST = -1239511,
        EXSDK_ER_ERROR = -100000,
        EXSDK_ER_PARAM_ERROR = -99999,
        EXSDK_ER_CREATE_FILE = -99998,
        EXSDK_ER_OPEN_FILE = -99997,
        EXSDK_ER_WRITE_FILE = -99996,
        EXSDK_ER_READ_FILE = -99995,
        EXSDK_ER_NO_SUPPORTED = -99994,
        EXSDK_ER_NET = -99993,					// NET ERROR
        EXSDK_ER_OBJ_EXIST = -99992,
        EXSDK_ER_TIMEOUT = -99991,
        EXSDK_ER_NOT_FOUND = -99990,
        EXSDK_ER_NEW_BUFFER = -99989,
        EXSDK_ER_NET_RECV = -99988,
        EXSDK_ER_NET_SEND = -99987,
        EXSDK_ER_OBJECT_BUSY = -99986,
        EXSDK_ER_SERVER_INTERNAL_ERROR = -99985,// 服务器内部错误
        EXSDK_ER_SERVER_BIND_PORT = -99984,		// 监听端口bind失败（端口被占用）
        EXSDK_ER_SERVER_LISTEN = -99983,		// 监听服务器启动失败
        EXSDK_ER_NET_SEND_BUF_FULL = -99982,	// 发送缓冲区满了
        EXSDK_ER_NO_BUFFER = -99981,			// 缓冲区大小不够或缓冲区满

        EXSDK_ER_USER_CANCEL = -90000,
        EXSDK_ER_Dev_NotLogin = -90002,			// 设备未登录
        EXSDK_ER_Dev_NotFound = -70119,			// Not Found
        EXSDK_ER_UserOrPassword = -70203,		// 登录设备密码错误
        EXSDK_ER_Illegal_User = -70205,		    // 非法用户
        EXSDK_ER_EE_NET_SOCKET = -1010,			// socket异常
        EXSDK_ER_JSON_PARSE = -69999,			// Json解析异常
    };

    public enum ESXSDK_CMD
    {
        ESXSDK_MSG_BEGIN = 12000,
        ESXSDK_DEV_LOGIN = 12001,				// 登录结果返回--XSDK_DevLogin

        ESXSDK_MEDIA_START_REAL_PLAY = 12002,	// 实时视频结果返回--XSDK_MediaRealPlay
        ESXSDK_MEDIA_START_FACE_IMAGE = 12003,	// 请求人脸抓图返回--XSDK_MediaGetFaceImage
        ESXSDK_MEDIA_START_RECORD_PLAY = 12004,	// 录像回放结果返回--XSDK_MediaRecordPlay
        ESXSDK_MEDIA_DOWN_RECORD_FILE = 12005,	// 录像下载
        ESXSDK_MEDIA_DOWN_IMAGES_FILE = 12006,	// 图片或缩略图下载
        ESXSDK_MEDIA_START_TALK = 12007,        // 开始对讲回调
        ESXSDK_MEDIA_STOPT_TALK = 12008,        // 结束对讲（服务器内部使用）
        ESXSDK_MEDIA_ON_INFO = 12010,			// 媒体信息回调
        ESXSDK_MEDIA_SET_PARAM = 12011,			// 修改参数
        ESXSDK_MEDIA_START_RECORD_PLAY_BYNAME = 12012,	// 按文件名称进行录像回放

        // 设备协议交互ESXSDK_DEV_GENERAL_COMMAND
        ESXSDK_DEV_GENERAL_COMMAND = 12100,		// 通用交互返回
        ESXSDK_DEV_GET_SYS_CONFIG = 12101,		// 设备系统配置获取
        ESXSDK_DEV_SET_SYS_CONFIG = 12102,		// 设备系统配置设置
        ESXSDK_DEV_GET_CHN_CONFIG = 12103,		// 设备通道配置获取
        ESXSDK_DEV_SET_CHN_CONFIG = 12104,		// 设备通道配置设置
        ESXSDK_DEV_FIND_FILE = 12105,			// 查询录像文件
        ESXSDK_DEV_SNAP = 12106,				// 设备通道抓图
        ESXSDK_DEV_TRANSPORT_OPEN = 12107,		// 打开设备透明串口
        ESXSDK_DEV_TRANSCOMWRITE = 12108,		// 向透明串口发送数据
        ESXSDK_DEV_ON_RECV_TRANSPORT_DATA = 12109,// 接收透明串口返回的数据
        ESXSDK_DEV_ON_SEARCH_CALENDAR = 12110,	// 查询录像日历
        ESXSDK_DEV_FIND_FILE_BYTIME = 12111,	// 按时间查询录像

        ESXSDK_DEV_USER_COMMAND_BEGIN = 12280,	 // 用户自定义消息ID开始
        ESXSDK_DEV_GENERAL_COMMAND_END1 = 12300,// 通用交互返回
        ESXSDK_DEV_GENERAL_COMMAND_END2 = 12499,// 通用交互内部使用

        ESXSDK_ON_DEV_STATE = 12500,			// 设备状态返回，param1参考：EXSDK_DEV_STATE
        ESXSDK_ON_DEV_ALARM_MSG = 1504,			// 设备报警回调消息ID
        ESXSDK_ON_SEARCH_DEVICES = 13001,		// 局域网设备搜索--XSDK_SearchDevices
        ESXSDK_MEDIA_ON_PLAY_STATE = 13002,		// 媒体状态回调
        ESXSDK_MEDIA_PAUSE = 13003,				// 媒体暂停/播放
        ESXSDK_MEDIA_SEEK_TO_TIME = 13004,		// 媒体Seek
        ESXSDK_MEDIA_SET_SPEED = 13005,			// 媒体Seek

        ESXSDK_DEV_UPGRADE = 13006,				// 升级设备返回

        ESXSDK_ON_DAS_SERVER_START = 13007,		// DAS服务器启动结果返回
        ESXSDK_ON_DAS_DEVICE_REGIST = 13008,	// DAS设备注册
        ESXSDK_DEV_SEND_COMMAND = 13009,		// 发送命令

        ESXSDK_DEV_SENDFILE = 13010,			// 发送文件的返回

        ESXSDK_DEV_UPGRADE_CLOUD = 13011,		// 云升级设备


        ESXSDK_DEV_ON_GET_STATE = 13013,		// 获取设备服务状态返回值
        ESXSDK_DEV_UPDATE_DEVSTATUS = 13014,	// 设备服务状态更新回调

        ESXSDK_PTL_DATA_TRANSPORT = 15000,		// 协议数据直接转发

        ESXSDK_DEV_EXPORTFILE = 15001,			// 导出文件数据返回

        ESXSDK_MSG_END = 16000,
    };

    public enum ESXSDK_DEV_COMMAND
    {
        EXCMD_GENERAL = -1,
        // C1: Log in, log out, and keep alive
        EXCMD_LOGIN_REQ = 1000,
        EXCMD_LOGIN_RSP = 1001,
        EXCMD_LOGOUT_REQ = 1002,
        EXCMD_LOGOUT_RSP = 1003,
        EXCMD_FORCELOGOUT_REQ = 1004,
        EXCMD_FORCELOGOUT_RSP = 1005,
        EXCMD_KEEPALIVE_REQ = 1006,
        EXCMD_KEEPALIVE_RSP = 1007,

        EXCMD_LOGIN_DAS_REQ = 1008,
        EXCMD_LOGIN_DAS_RSP = 1009,

        EXCMD_LOGIN_INFO_ENCRYPT_REQ = 1010,
        EXCMD_LOGIN_INFO_ENCRYPT_RSP = 1011,

        // C2: System information
        EXCMD_SYSINFO_REQ = 1020,
        EXCMD_SYSINFO_RSP = 1021,

        //C3: Encoding configuration, occlusion, overlay, image color
        //C4: Recording settings
        //C5: Dynamic detection, occlusion, video loss, external alarm, network alarm, storage alarm
        //C6: General network configuration, network service configuration
        //C7: Serial port configuration
        //C8: PTZ configuration, preset point, cruise
        //C9: Local patrol, TV mediation, video input, output, audio input
        //C10: General configuration, localized configuration
        //C11: Automatic maintenance
        EXCMD_CONFIG_SET = 1040,
        EXCMD_CONFIG_SET_RSP = 1041,
        EXCMD_CONFIG_GET = 1042,
        EXCMD_CONFIG_GET_RSP = 1043,
        EXCMD_DEFAULT_CONFIG_GET = 1044,
        EXCMD_DEFAULT_CONFIG_GET_RSP = 1045,
        EXCMD_CONFIG_CHANNELTILE_SET = 1046,
        EXCMD_CONFIG_CHANNELTILE_SET_RSP = 1047,
        EXCMD_CONFIG_CHANNELTILE_GET = 1048,
        EXCMD_CONFIG_CHANNELTILE_GET_RSP = 1049,

        EXCMD_CONFIG_CHANNELTILE_DOT_SET = 1050,
        EXCMD_CONFIG_CHANNELTILE_DOT_SET_RSP = 1051,

        // System commissioning
        EXCMD_SYSTEM_DEBUG_REQ = 1052,
        EXCMD_SYSTEM_DEBUG_RSP = 1053,
        // OSD three-line dot-matrix information
        EXCMD_CONFIG_OSDINFO_DOT_SET = 1054,
        EXCMD_CONFIG_OSDINFO_DOT_SET_RSP = 1055,

        // C12: Capability level query
        EXCMD_ABILITY_GET = 1360,
        EXCMD_ABILITY_GET_RSP = 1361,

        // C13: PTZ control
        EXCMD_PTZ_REQ = 1400,
        EXCMD_PTZ_RSP = 1401,

        // C14: Monitoring control
        EXCMD_MONITOR_REQ = 1410,
        EXCMD_MONITOR_RSP = 1411,
        EXCMD_MONITOR_DATA = 1412,
        EXCMD_MONITOR_CLAIM = 1413,
        EXCMD_MONITOR_CLAIM_RSP = 1414,

        // C15: Playback Control
        EXCMD_PLAY_REQ = 1420,
        EXCMD_PLAY_RSP = 1421,
        EXCMD_PLAY_DATA = 1422,
        EXCMD_PLAY_EOF = 1423,
        EXCMD_PLAY_CLAIM = 1424,
        EXCMD_PLAY_CLAIM_RSP = 1425,
        EXCMD_DOWNLOAD_DATA = 1426,

        // C16: Voice intercom control
        EXCMD_TALK_REQ = 1430,
        EXCMD_TALK_RSP = 1431,
        EXCMD_TALK_CU_PU_DATA = 1432,
        EXCMD_TALK_PU_CU_DATA = 1433,
        EXCMD_TALK_CLAIM = 1434,
        EXCMD_TALK_CLAIM_RSP = 1435,
        EXCMD_TALK_NVR_TO_IPC_REQ = 1436, // NVR and its connected front end start intercom
        EXCMD_TALK_NVR_TO_IPC_RSP = 1437,

        // C17: File query includes video files, picture files and log files
        EXCMD_FILESEARCH_REQ = 1440,
        FILESEARCH_RSP = 1441,
        EXCMD_LOGSEARCH_REQ = 1442,
        EXCMD_LOGSEARCH_RSP = 1443,
        EXCMD_FILESEARCH_BYTIME_REQ = 1444,
        EXCMD_FILESEARCH_BYTIME_RSP = 1445,

        // Query Calendar
        EXCMD_FILESEARCH_CALENDAR_REQ = 1446,
        EXCMD_FILESEARCH_CALENDAR_RSP = 1447,

        // C18: System management
        EXCMD_SYSMANAGER_REQ = 1450,
        EXCMD_SYSMANAGER_RSP = 1451,

        // System time and video mode query
        EXCMD_TIMEQUERY_REQ = 1452,
        EXCMD_TIMEQUERY_RSP = 1453,

        // C19: Hard disk management
        EXCMD_DSIKMANAGER_REQ = 1460,
        EXCMD_DSIKMANAGER_RSP = 1461,

        // C20: User management
        EXCMD_FULLAUTHORITYLIST_GET = 1470,
        EXCMD_FULLAUTHORITYLIST_GET_RSP = 1471,
        EXCMD_USERS_GET = 1472,
        EXCMD_USERS_GET_RSP = 1473,
        EXCMD_GROUPS_GET = 1474,
        EXCMD_GROUPS_GET_RSP = 1475,
        EXCMD_ADDGROUP_REQ = 1476,
        EXCMD_ADDGROUP_RSP = 1477,
        EXCMD_MODIFYGROUP_REQ = 1478,
        EXCMD_MODIFYGROUP_RSP = 1479,
        EXCMD_DELETEGROUP_REQ = 1480,
        EXCMD_DELETEGROUP_RSP = 1481,
        EXCMD_ADDUSER_REQ = 1482,
        EXCMD_ADDUSER_RSP = 1483,
        EXCMD_MODIFYUSER_REQ = 1484,
        EXCMD_MODIFYUSER_RSP = 1485,
        EXCMD_DELETEUSER_REQ = 1486,
        EXCMD_DELETEUSER_RSP = 1487,
        EXCMD_MODIFYPASSWORD_REQ = 1488,
        EXCMD_MODIFYPASSWORD_RSP = 1489,

        // C21: Alarm deployment/withdrawal, alarm reporting
        EXCMD_GUARD_REQ = 1500,
        EXCMD_GUARD_RSP = 1501,
        EXCMD_UNGUARD_REQ = 1502,
        EXCMD_UNGUARD_RSP = 1503,
        EXCMD_ALARM_REQ = 1504,
        EXCMD_ALARM_RSP = 1505,
        EXCMD_NET_ALARM_REQ = 1506,
        EXCMD_NET_ALARM_RSP = 1507,
        EXCMD_ALARMCENTER_MSG_REQ = 1508,

        // C22: System upgrade control
        EXCMD_UPGRADE_REQ = 1520,
        EXCMD_UPGRADE_RSP = 1521,
        EXCMD_UPGRADE_DATA = 1522,
        EXCMD_UPGRADE_DATA_RSP = 1523,
        EXCMD_UPGRADE_PROGRESS = 1524,
        EXCMD_UPGRADE_INFO_REQ = 1525,
        EXCMD_UPGRADE_INFO_RSQ = 1526,
        EXCMD_UPGRADE_RESULT = 1527, // Upgrade result notification

        // C23: Device automatic search
        EXCMD_IPSEARCH_REQ = 1530,
        EXCMD_IPSEARCH_RSP = 1531,
        EXCMD_IP_SET_REQ = 1532,
        EXCMD_IP_SET_RSP = 1533,

        // C24: System information import and export
        EXCMD_CONFIG_IMPORT_REQ = 1540,
        EXCMD_CONFIG_IMPORT_RSP = 1541,
        EXCMD_CONFIG_EXPORT_REQ = 1542,
        EXCMD_CONFIG_EXPORT_RSP = 1543,
        EXCMD_LOG_EXPORT_REQ = 1544,
        EXCMD_LOG_EXPORT_RSP = 1545,

        // C25: Network keyboard
        EXCMD_NET_KEYBOARD_REQ = 1550,
        EXCMD_NET_KEYBOARD_RSP = 1551,

        // Network capture
        EXCMD_NET_SNAP_REQ = 1560,
        EXCMD_NET_SNAP_RSP = 1561,

        EXCMD_SET_IFRAME_REQ = 1562,
        EXCMD_SET_IFRAME_RSP = 1563,

        // Transparent serial port
        EXCMD_RS232_READ_REQ = 1570,
        EXCMD_RS232_READ_RSP = 1571,
        EXCMD_RS232_WRITE_REQ = 1572,
        EXCMD_RS232_WRITE_RSP = 1573,
        EXCMD_RS485_READ_REQ = 1574,
        EXCMD_RS485_READ_RSP = 1575,
        EXCMD_RS485_WRITE_REQ = 1576,
        EXCMD_RS485_WRITE_RSP = 1577,

        EXCMD_TRANSPARENT_COMM_REQ = 1578,
        EXCMD_TRANSPARENT_COMM_RSP = 1579,
        EXCMD_RS485_TRANSPARENT_DATA_REQ = 1580,
        EXCMD_RS485_TRANSPARENT_DATA_RSP = 1581,
        EXCMD_RS232_TRANSPARENT_DATA_REQ = 1582,
        EXCMD_RS232_TRANSPARENT_DATA_RSP = 1583,

        // Network login time synchronization
        EXCMD_SYNC_TIME_REQ = 1590,
        EXCMD_SYNC_TIME_RSP = 1591,
        // UI screenshot
        EXCMD_PHOTO_GET_REQ = 1600,
        EXCMD_PHOTO_GET_RSP = 1601,

        // Upload data
        EXCMD_UPLOAD_DATA_START_REQ = 1610,
        EXCMD_UPLOAD_DATA_START_RSP = 1611,
        EXCMD_UPLOAD_DATA_STOP_REQ = 1612,
        EXCMD_UPLOAD_DATA_STOP_RSP = 1613,

        // 1614 - 1629 MSG is reserved to distinguish upload data types
        EXCMD_VEHICLE_INFO_REQ = 1614,
        EXCMD_VEHICLE_INFO_RSP = 1615,

        EXCMD_RECORD_STATE_REQ = 1616,
        EXCMD_RECORD_STATE_RSP = 1617,

        EXCMD_DIGITCHN_STATE_REQ = 1618,
        EXCMD_DIGITCHN_STATE_RSP = 1619,

        EXCMD_TITLE_INFO_REQ = 1620,
        EXCMD_TITLE_INFO_RSP = 1621,

        // Population statistics
        EXCMD_CPC_DATA_SEARCH_REQ = 1630,
        EXCMD_CPC_DATA_SEARCH_RSP = 1631,
        EXCMD_CPC_DATA_CLEAR_REQ = 1632,
        EXCMD_CPC_DATA_CLEAR_RSP = 1633,

        // Remote search
        EXCMD_NET_LOCALSEARCH_REQ = 1634,
        EXCMD_NET_LOCALSEARCH_RSP = 1635,

        // Mail test
        EXCMD_NET_MAILTEST_REQ = 1636,
        EXCMD_NET_MAILTEST_RSP = 1637,

        // Phone message
        EXCMD_PHONE_INFO_SET = 1638,
        EXCMD_PHONE_INFO_SET_RSP = 1639,

        // Hard disk information
        EXCMD_NET_RECORD_INFO_REQ = 1640,
        EXCMD_NET_RECORD_INFO_RSP = 1641,

        // File operation, including deleting and adding folders
        EXCMD_NET_FILE_OPRATE_REQ = 1642,
        EXCMD_NET_FILE_OPRATE_RSP = 1643,

        // The default configuration is exported
        EXCMD_NET_CUSTOM_CFG_EXPORT_REQ = 1644,
        EXCMD_NET_CUSTOM_CFG_EXPORT_RSP = 1645,

        // Local audio file search
        EXCMD_MUSICFILESEARCH_REQ = 1646,
        EXCMD_MUSICFILESEARCH_RSP = 1647,

        // Local audio file playback control
        EXCMD_MUSICPLAY_REQ = 1648,
        EXCMD_MUSICPLAY_RSP = 1649,

        EXCMD_AUTHORIZATION_REQ = 1650,
        EXCMD_AUTHORIZATION_RSQ = 1651,

        EXCMD_SET_DIG_IP_REQ = 1652,
        EXCMD_SET_DIG_IP_RSP = 1653,

        // Set OSD information and provide it to customers
        EXCMD_SET_OSD_INFO_REQ = 1654,
        EXCMD_SET_OSD_INFO_RSP = 1655,

        // OSD overlay, used for real-time overlay, without saving configuration
        EXCMD_SET_OSD_INFO_REQ_V2 = 1656,
        EXCMD_SET_OSD_INFO_RSP_V2 = 1657,

        // Language export import
        EXCMD_EXPORT_LANGUAGE_REQ = 1666,
        EXCMD_EXPORT_LANGUAGE_RSP = 1667,
        EXCMD_IMPORT_LANGUAGE_REQ = 1668,
        EXCMD_IMPORT_LANGUAGE_RSP = 1669,
        EXCMD_DELETE_LANGUAGE_REQ = 1770,
        EXCMD_DELETE_LANGUAGE_RSP = 1771,

        // DDNS Apply aps key function
        EXCMD_NET_DDNSAPPLY_REQ = 1774,
        EXCMD_NET_DDNSAPPLY_RSP = 1775,
        // DDNS Internet IP address message (customized by APS customers)
        EXCMD_NET_DDNSIPADDRESS_REQ = 1776,
        EXCMD_NET_DDNSIPADDRESS_RSP = 1777,

        // Cloud upgrade control
        EXCMD_CLOUD_VERSION_REQ = 2000,
        EXCMD_CLOUD_VERSION_RSP = 2001,
        EXCMD_CLOUD_UPGRADE_START_REQ = 2002,
        EXCMD_CLOUD_UPGRADE_START_RSP = 2003,
        EXCMD_CLOUD_UPGRADE_STOP_REQ = 2004,
        EXCMD_CLOUD_UPGRADE_STOP_RSP = 2005,
        EXCMD_CLOUD_UPGRADE_PROGRESS = 2006,

        // FTP
        EXCMD_NET_FTPTEST_REQ = 2008,
        EXCMD_NET_FTPTEST_RSP = 2009,
        // Intercom recovery audio switch
        EXCMD_TLAK_ONLY_RECVCONFIG_REQ = 2010,
        EXCMD_TLAK_ONLY_RECVCONFIG_RSP = 2011,

        // Set the recording indicator status
        EXCMD_FB_EXTRA_STATE_REQ = 2012,
        EXCMD_FB_EXTRA_STATE_RSP = 2013,

        // Get video indicator status
        EXCMD_FB_EXTRA_GET_STATE_REQ = 2014,
        EXCMD_FB_EXTRA_GET_STATE_RSP = 2015,
        EXCMD_CLOUD_NEW_VERSION_REQ = 2016,		// The new version client uses this command to query the version information
        EXCMD_CLOUD_NEW_VERSION_RSP = 2017,
        EXCMD_CLOUD_NEW_UPGRADE_START_REQ = 2018,
        EXCMD_CLOUD_NEW_UPGRADE_START_RSP = 2019,


        EXCMD_NET_SPLIT_CONTROL_REQ = 2020,
        EXCMD_NET_SPLIT_CONTROL_RSP = 2021,

        EXCMD_CONSUMER_STATE_UPLOAD_REQ = 2022,
        EXCMD_CONSUMER_STATE_UPLOAD_RSP = 2023,

        EXCMD_ELECT_STATE_REQ = 2024,
        EXCMD_ELECT_STATE_RSP = 2025,

        // Fisheye calibration center
        EXCMD_NET_FISHEYE_MODIFY_CENTER_REQ = 2026,
        EXCMD_NET_FISHEYE_MODIFY_CENTER_RSP = 2027,

        EXCMD_NET_FILE_BACKUP_REQ = 2030,	    // Backup to USB drive control
        EXCMD_NET_FILE_BACKUP_RSP = 2031,

        // Set a language
        EXCMD_SET_SUPPORT_LANGUAGE_REQ = 2036,
        EXCMD_SET_SUPPORT_LANGUAGE_RSP = 2037,

        EXCMD_GET_BREVIARY_PIC_REQ = 2038,      // Video thumbnail request
        EXCMD_GET_BREVIARY_PIC_RSP = 2039,      // Video thumbnail request return
        EXCMD_GET_BREVIARY_PIC_DATA_RSP = 2140, // Video thumbnail data return

        EXCMD_MUSICBOX_STATE_REQ = 2050,
        MUSICBOX_STATE_RSP = 2051,

        EXCMD_FACE_IMAGE_GET_REQ = 2060,
        EXCMD_FACE_IMAGE_GET_RSP = 2061,

        EXCMD_FACE_IMAGE_CLAIM_REQ = 2062,
        EXCMD_FACE_IMAGE_CLAIM_RSP = 2063,
        EXCMD_FACE_IMAGE_DATA = 2064,

        // Sub-links reported by intelligent analysis remain alive (common connections may not exist)
        // Ask the server to confirm whether the device sub-link still exists. No reply is required
        EXCMD_INTEL_ANALYSE_OPT_KEEPALIVE = 2066,
        EXCMD_INTEL_ANALYSE_OPT_KEEPALIVE_RSP = 2067,

        // Get equipment information: 1. Video recording 2. Equipment connection signal 3. Number of people connected 4. Equipment version information
        EXCMD_DEVICE_INFORMATION_REQ = 2088,
        EXCMD_DEVICE_INFORMATION_RSP = 2089,

        EXCMD_EXTERNAL_SENSOR_OPERATE_REQ = 2128,

        // Subscription cruise report ended
        EXCMD_PTZ_TOUR_END_RSP = 2141,

        // Basic operation of picture import
        EXCMD_INTEL_FACE_PIC_IMPORT_REQ = 2170,			// Picture import request
        EXCMD_INTEL_FACE_PIC_IMPORT_RSP = 2171,
        EXCMD_INTEL_FACE_PICDATA_IMPORT_REQ = 2172,		// Picture data import
        EXCMD_INTEL_FACE_PICDATA_IMPORT_RSP = 2173,
        EXCMD_INTEL_FACE_IMPORT_RESULT_REQ = 2174,		// Import Picture Result Request
        EXCMD_INTEL_FACE_IMPORT_RESULT_RSP = 2175,
        EXCMD_INTEL_FACE_EXPORT_RESULT_REQ = 2176,		// Export all results
        EXCMD_INTEL_FACE_EXPORT_RESULT_RSP = 2177,
        EXCMD_INTEL_FACE_DATA_WRITE_RSP = 2178,			// Write data to FPGA and return data corresponding to 2172 and 2173	

        // Cloud upgrade IPC control
        EXCMD_CLOUD_IPC_VERSION_REQ = 2250,		        // IPC Version query request
        EXCMD_CLOUD_IPC_VERSION_RSP = 2251,		        // IPC Version query response
        EXCMD_CLOUD_IPC_UPGRADE_START_REQ = 2252,		// Cloud upgrade IPC start request
        EXCMD_CLOUD_IPC_UPGRADE_START_RSP = 2253,		// Cloud upgrade IPC begins to respond
        EXCMD_CLOUD_IPC_UPGRADE_STOP_REQ = 2254,		// Cloud upgrade IPC end request
        EXCMD_CLOUD_IPC_UPGRADE_STOP_RSP = 2255,		// Cloud upgrade IPC end response
        EXCMD_CLOUD_IPC_DOWNLOAD_PROGRESS = 2256,		// Cloud upgrade IPC download progress
        EXCMD_CLOUD_IPC_UPGRADE_PROGRESS = 2257,		// Cloud upgrade IPC progress
        EXCMD_CLOUD_IPC_UPGRADE_RESULT = 2258, 		    // Cloud upgrade IPC result notification

        // IE sends files to upgrade IPC control
        EXCMD_FILE_UPGRADE_IPC_INFO_REQ = 2260,		    // Front-end IPC current version information request
        EXCMD_FILE_UPGRADE_IPC_INFO_RSP = 2261,		    // Front-end IPC current version information response
        EXCMD_FILE_UPGRADE_IPC_REQ = 2262,			    // Upgrade IPC request
        EXCMD_FILE_UPGRADE_IPC_RSP = 2263,			    // Upgrade IPC response
        EXCMD_FILE_UPGRADE_IPC_DATA = 2264,			    // Send packets for upgrading IPC
        EXCMD_FILE_UPGRADE_IPC_DATA_RSP = 2265,		    // Packet response
        EXCMD_FILE_UPGRADE_IPC_PROGRESS = 2266,		    // Upgrade progress
        EXCMD_FILE_UPGRADE_IPC_RESULT = 2267,		    // Upgrade result notification


        // Get the intelligence (PEA, OSC, AVD) supported by the corresponding channel
        EXCMD_NET_GET_DEVICE_INTELL_ABILITY_REQ = 2270,
        EXCMD_NET_GET_DEVICE_INTELL_ABILITY_RSP = 2271,

        // Get the corresponding channel intelligent configuration
        EXCMD_NET_GET_DEVICE_INTELL_INFO_REQ = 2272,
        EXCMD_NET_GET_DEVICE_INTELL_INFO_RSP = 2273,

        // Set the corresponding channel intelligent configuration	
        EXCMD_NET_SET_DEVICE_INTELL_INFO_REQ = 2274,
        EXCMD_NET_SET_DEVICE_INTELL_INFO_RSP = 2275,

        // Set any channel configuration
        EXCMD_NET_SET_DEVICE_INTELL_ALL_INFO_REQ = 2276,
        EXCMD_NET_SET_DEVICE_INTELL_ALL_INFO_RSP = 2277,

        EXCMD_MODEINDEX_UPLOAD_REQ = 3014,

        EXCMD_FACE_RECOGNITION_OPT_DATA = 3016,

        // Send file data to device
        EXCMD_FILE_TRANS_REQ = 3500,
        EXCMD_FILE_TRANS_RSP = 3501,
        EXCMD_FILE_DATA_SEND_REQ = 3502,
        EXCMD_FILE_DATA_SEND_RSP = 3503,
        EXCMD_FILE_DATA_RECV_REQ = 3504,		    // The web end receives the file and the device end sends it
        EXCMD_FILE_DATA_RECV_RSP = 3505,

        // Mobile terminal use
        // 	EXCMD_GENERALSTATE_UPLOAD_REQ = 3016,   // General status reporting
        // 	EXCMD_GENERALSTATE_UPLOAD_RSP = 3017,
        EXCMD_GET_LOGIN_ENCRYPTION_TYPE = 99999,    // Get device login password encryption type
    };


    public enum EUIMSG
    {
        EUIMSG_PLAY_START = 30000,            // 开始播放
        EUIMSG_PLAY_PAUSE = 30001,            // 暂停播放
        EUIMSG_PLAY_STOP = 30002,             // 播放结束(数据异常停止返回或文件播放结束返回)
        EUIMSG_START_BUFFER_DATA = 30003,     // 正在缓存数据
        EUIMSG_END_BUFFER_DATA = 30004,       // 缓存结束,开始播放
        EUIMSG_PLAY_MEDIA_FRAME_LOSS = 30005, // 超过4S没有收到数据
        EUIMSG_PLAY_INFO = 30006,             // 播放信息
        EUIMSG_PLAY_SAVE_IMAGE_FILE = 30007,  // 本地保存图片
        EUIMSG_PLAY_CATCH_PIC_BUFFER = 30008, // 获取图片数据
        EUIMSG_AUDIO_DATA = 30009,            // 采集到的音频数据
        EUIMSG_YUV_DATA = 30010,              // YUV数据
        EUIMSG_RECORD_START = 30011,          // 开始录像
        EUIMSG_RECORD_STOP = 30012,           // 录像结束
        EUIMSG_ON_FILE_DOWNLOAD = 30013,        // 文件下载
        EUIMSG_PLAY_SOUND = 30014,              // 播放音频
        EUIMSG_DECODE_PCM = 30015,              // PCM数据
        EUIMSG_OPEN_SEND_DATA_CHANNEL = 30016,  // 打开发送数据通道
        EUIMSG_CLOSE_SEND_DATA_CHANNEL = 30017, // 关闭发送数据通道
        EUIMSG_SEND_DATA = 30018,               // 发送数据
        EUIMSG_CAPTURE_AUDIO = 30019,           // 采集音频结果
        EUIMSG_ON_FRAME_USR_DATA = 30020,       // 用户自定义信息帧回调
    }

    // 通道状态枚举
    public  enum EMediaChnState
    {
        EState_Media_NetDisConnect = 2, // 通道断线
        EState_Media_NetConnecting = 3, // 正在连接
        EState_Media_NetConnected = 4,  // 网络连接成功
        EState_Media_RecvData = 8,      // 正在接收数据
        EState_Media_DataEnd = 9,       // 数据接收结束
    };
}